﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Excel;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_BCTinhHinhSuDungHoaDon : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CmdCapNhat")]
        private System.Windows.Forms.Button _CmdCapNhat;
        [AccessedThroughProperty("CmdExcel")]
        private System.Windows.Forms.Button _CmdExcel;
        [AccessedThroughProperty("CmdIn")]
        private System.Windows.Forms.Button _CmdIn;
        [AccessedThroughProperty("CmdThoat")]
        private System.Windows.Forms.Button _CmdThoat;
        [AccessedThroughProperty("Label1")]
        private System.Windows.Forms.Label _Label1;
        [AccessedThroughProperty("Label2")]
        private System.Windows.Forms.Label _Label2;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel2")]
        private Panel _Panel2;
        [AccessedThroughProperty("Panel3")]
        private Panel _Panel3;
        [AccessedThroughProperty("updNam1")]
        private NumericUpDown _updNam1;
        [AccessedThroughProperty("updNam2")]
        private NumericUpDown _updNam2;
        [AccessedThroughProperty("updThang1")]
        private NumericUpDown _updThang1;
        [AccessedThroughProperty("updThang2")]
        private NumericUpDown _updThang2;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private clsXuatKho objXK;
        private System.Data.DataTable pData;
        private string strNamThang1;
        private string strNamThang2;

        public Frm_BCTinhHinhSuDungHoaDon()
        {
            base.Load += new EventHandler(this.Frm_BCTinhHinhSuDungHoaDon_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.pData = null;
            this.objXK = new clsXuatKho();
            this.strNamThang1 = "";
            this.strNamThang2 = "";
            this.InitializeComponent();
        }

        public bool CheckIvalid()
        {
            string left = LVYModule.sRight("0000" + this.updNam1.Value.ToString(), 4) + LVYModule.sRight("00" + Conversions.ToString(this.updThang1.Value), 2);
            string right = LVYModule.sRight("0000" + this.updNam2.Value.ToString(), 4) + LVYModule.sRight("00" + Conversions.ToString(this.updThang2.Value), 2);
            if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(left, right, false) > 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Năm th\x00e1ng đầu phải nhỏ hơn hoặc bằng năm th\x00e1ng sau!", ""));
                return false;
            }
            return true;
        }

        private void CmdCapNhat_Click(object sender, EventArgs e)
        {
            this.LoadData();
        }

        private void CmdExcel_Click(object sender, EventArgs e)
        {
            if (this.pData != null)
            {
                if (this.pData.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
                }
                else
                {
                    try
                    {
                        SaveFileDialog dialog = new SaveFileDialog {
                            Filter = "Excel Files|*.xls",
                            Title = "Save an Excel file"
                        };
                        dialog.ShowDialog();
                        if (dialog.FileName != "")
                        {
                            this.VSlist.SaveExcel(dialog.FileName, "BAOCAOTINHHINHSUDUNGHOADON", FileFlags.None);
                            Excel.Application application = new ApplicationClass();
                            Workbook workbook = application.Workbooks.Open(dialog.FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
                            Excel.Application application2 = application;
                            NewLateBinding.LateCall(application2.Worksheets[1], null, "Select", new object[0], null, null, null, true);
                            application2.get_Range("A1:V" + Conversions.ToString((int) (this.VSlist.Rows.Count - 5)), Missing.Value).Select();
                            NewLateBinding.LateCall(application2.Selection, null, "Cut", new object[0], null, null, null, true);
                            application2.get_Range("A16", Missing.Value).Select();
                            NewLateBinding.LateCall(application2.ActiveSheet, null, "Paste", new object[0], null, null, null, true);
                            application2.get_Range("A11:A14", Missing.Value).Select();
                            object selection = application2.Selection;
                            NewLateBinding.LateSetComplex(selection, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "MergeCells", new object[] { true }, null, null, false, true);
                            selection = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("A11:A14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "STT";
                            application2.get_Range("B11:B14", Missing.Value).Select();
                            object instance = application2.Selection;
                            NewLateBinding.LateSetComplex(instance, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(instance, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(instance, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(instance, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(instance, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(instance, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(instance, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(instance, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(instance, null, "MergeCells", new object[] { true }, null, null, false, true);
                            instance = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("B11:B14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "T\x00ean loại h\x00f3a đơn";
                            application2.get_Range("C11:C14", Missing.Value).Select();
                            object obj4 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj4, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj4, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj4, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj4, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj4, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj4, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj4, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj4, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj4, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj4 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("C11:C14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "K\x00fd hiệu mẫu h\x00f3a đơn";
                            application2.get_Range("D11:D14", Missing.Value).Select();
                            object obj5 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj5, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj5, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj5, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj5, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj5, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj5, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj5, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj5, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj5, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj5 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("D11:D14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "K\x00fd hiệu h\x00f3a đơn";
                            application2.get_Range("E12:E14", Missing.Value).Select();
                            object obj6 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj6, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj6, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj6, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj6, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj6, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj6, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj6, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj6, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj6, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj6 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("E12:E14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Tổng số";
                            application2.get_Range("E11:I11", Missing.Value).Select();
                            object obj7 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj7, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj7, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj7, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj7, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj7, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj7, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj7, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj7, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj7, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj7 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("E11:I11", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số tồn đầu kỳ, mua/ph\x00e1t h\x00e0nh trong kỳ";
                            application2.get_Range("J11:S11", Missing.Value).Select();
                            object obj8 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj8, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj8, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj8, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj8, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj8, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj8, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj8, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj8, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj8, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj8 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("J11:S11", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số sử dụng, x\x00f3a bỏ, mất, hủy trong kỳ";
                            application2.get_Range("T11:V13", Missing.Value).Select();
                            object obj9 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj9, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj9 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("T11:V13", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Tồn cuối kỳ";
                            application2.get_Range("M12:S12", Missing.Value).Select();
                            object obj10 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj10, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj10 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("M12:S12", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Trong đ\x00f3";
                            application2.get_Range("J12:L13", Missing.Value).Select();
                            object obj11 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj11, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj11 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("J12:L13", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Tổng số sử dụng, x\x00f3a bỏ, mất, hủy";
                            application2.get_Range("H12:I13", Missing.Value).Select();
                            object obj12 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj12, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj12 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("H12:I13", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số mua/ph\x00e1t h\x00e0nh trong kỳ";
                            application2.get_Range("F12:G13", Missing.Value).Select();
                            object obj13 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj13, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj13 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("F12:G13", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số tồn đầu kỳ";
                            application2.get_Range("M13:M14", Missing.Value).Select();
                            object obj14 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj14, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj14 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("M13:M14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số lượng đ\x00e3 sử dụng";
                            application2.get_Range("N13:O13", Missing.Value).Select();
                            object obj15 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj15, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj15 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("N13:O13", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "X\x00f3a bỏ";
                            application2.get_Range("P13:Q13", Missing.Value).Select();
                            object obj16 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj16, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj16 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("P13:Q13", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Mất";
                            application2.get_Range("R13:S13", Missing.Value).Select();
                            object obj17 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj17, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj17 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("R13:S13", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Hủy";
                            application2.get_Range("F14", Missing.Value).Select();
                            object obj18 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj18, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj18 = null;
                            application2.get_Range("F14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Từ số";
                            application2.get_Range("G14", Missing.Value).Select();
                            object obj19 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj19, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj19 = null;
                            application2.get_Range("G14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Đến số";
                            application2.get_Range("H14", Missing.Value).Select();
                            object obj20 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj20, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj20 = null;
                            application2.get_Range("H14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Từ số";
                            application2.get_Range("I14", Missing.Value).Select();
                            object obj21 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj21, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj21 = null;
                            application2.get_Range("I14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Đến số";
                            application2.get_Range("J14", Missing.Value).Select();
                            object obj22 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj22, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj22 = null;
                            application2.get_Range("J14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Từ số";
                            application2.get_Range("K14", Missing.Value).Select();
                            object obj23 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj23, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj23 = null;
                            application2.get_Range("K14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Đến số";
                            application2.get_Range("L14", Missing.Value).Select();
                            object obj24 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj24, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj24 = null;
                            application2.get_Range("L14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Cộng";
                            application2.get_Range("N14", Missing.Value).Select();
                            object obj25 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj25, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj25 = null;
                            application2.get_Range("N14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số lượng";
                            application2.get_Range("O14", Missing.Value).Select();
                            object obj26 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj26, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj26 = null;
                            application2.get_Range("O14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số";
                            application2.get_Range("P14", Missing.Value).Select();
                            object obj27 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj27, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj27, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj27, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj27, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj27, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj27, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj27, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj27, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj27, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj27 = null;
                            application2.get_Range("P14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số lượng";
                            application2.get_Range("Q14", Missing.Value).Select();
                            object obj28 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj28, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj28, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj28, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj28, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj28, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj28, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj28, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj28, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj28, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj28 = null;
                            application2.get_Range("Q14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số";
                            application2.get_Range("R14", Missing.Value).Select();
                            object obj29 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj29, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj29 = null;
                            application2.get_Range("R14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số lượng";
                            application2.get_Range("S14", Missing.Value).Select();
                            object obj30 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj30, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj30, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj30, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj30, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj30, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj30, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj30, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj30, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj30, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj30 = null;
                            application2.get_Range("S14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số";
                            application2.get_Range("T14", Missing.Value).Select();
                            object obj31 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj31, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj31, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj31, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj31, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj31, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj31, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj31, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj31, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj31, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj31 = null;
                            application2.get_Range("T14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Từ số";
                            application2.get_Range("U14", Missing.Value).Select();
                            object obj32 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj32, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj32, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj32, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj32, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj32, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj32, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj32, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj32, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj32, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj32 = null;
                            application2.get_Range("U14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Đến số";
                            application2.get_Range("V14", Missing.Value).Select();
                            object obj33 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj33, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj33, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj33, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj33, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj33, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj33, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj33, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj33, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj33, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj33 = null;
                            application2.get_Range("V14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số lượng";
                            NewLateBinding.LateSetComplex(application2.Rows["14:14", Missing.Value], null, "RowHeight", new object[] { 0x25 }, null, null, false, true);
                            application2.get_Range("A15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "1";
                            application2.get_Range("B15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "2";
                            application2.get_Range("C15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "3";
                            application2.get_Range("D15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "4";
                            application2.get_Range("E15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "5";
                            application2.get_Range("F15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "6";
                            application2.get_Range("G15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "7";
                            application2.get_Range("H15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "8";
                            application2.get_Range("I15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "9";
                            application2.get_Range("J15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "10";
                            application2.get_Range("K15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "11";
                            application2.get_Range("L15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "12";
                            application2.get_Range("M15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "13";
                            application2.get_Range("N15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "14";
                            application2.get_Range("O15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "15";
                            application2.get_Range("P15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "16";
                            application2.get_Range("Q15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "17";
                            application2.get_Range("R15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "18";
                            application2.get_Range("S15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "19";
                            application2.get_Range("T15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "20";
                            application2.get_Range("U15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "21";
                            application2.get_Range("V15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "22";
                            application2.get_Range("A15:V15", Missing.Value).Select();
                            object obj34 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj34, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj34, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj34, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj34, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj34, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj34, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj34, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj34, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            obj34 = null;
                            application2.get_Range("A11:V" + Conversions.ToString((int) (this.VSlist.Rows.Count + 10)), Missing.Value).Select();
                            NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 5 }, null, null, null), null, "LineStyle", new object[] { -4142 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 6 }, null, null, null), null, "LineStyle", new object[] { -4142 }, null, null, false, true);
                            object obj35 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 7 }, null, null, null);
                            NewLateBinding.LateSetComplex(obj35, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj35, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj35, null, "Weight", new object[] { 2 }, null, null, false, true);
                            obj35 = null;
                            object obj36 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 8 }, null, null, null);
                            NewLateBinding.LateSetComplex(obj36, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj36, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj36, null, "Weight", new object[] { 2 }, null, null, false, true);
                            obj36 = null;
                            object obj37 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 9 }, null, null, null);
                            NewLateBinding.LateSetComplex(obj37, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj37, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj37, null, "Weight", new object[] { 2 }, null, null, false, true);
                            obj37 = null;
                            object obj38 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 10 }, null, null, null);
                            NewLateBinding.LateSetComplex(obj38, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj38, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj38, null, "Weight", new object[] { 2 }, null, null, false, true);
                            obj38 = null;
                            object obj39 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 11 }, null, null, null);
                            NewLateBinding.LateSetComplex(obj39, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj39, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj39, null, "Weight", new object[] { 2 }, null, null, false, true);
                            obj39 = null;
                            object obj40 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 12 }, null, null, null);
                            NewLateBinding.LateSetComplex(obj40, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj40, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj40, null, "Weight", new object[] { 2 }, null, null, false, true);
                            obj40 = null;
                            application2.get_Range("A4:V4", Missing.Value).Select();
                            object obj41 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj41, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj41, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj41, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj41, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj41, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj41, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj41, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj41, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj41, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj41 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("A4:V4", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "B\x00c1O C\x00c1O T\x00ccNH H\x00ccNH SỬ DỤNG H\x00d3A ĐƠN";
                            Excel.Font font = application2.ActiveCell.get_Characters(1, 0x21).Font;
                            font.Name = "Times New Roman";
                            font.FontStyle = "Bold";
                            font.Size = 0x10;
                            font.Strikethrough = false;
                            font.Superscript = false;
                            font.Subscript = false;
                            font.OutlineFont = false;
                            font.Shadow = false;
                            font.Underline = -4142;
                            font.ColorIndex = -4105;
                            font = null;
                            NewLateBinding.LateSetComplex(application2.Rows["4:4", Missing.Value], null, "RowHeight", new object[] { 0x25 }, null, null, false, true);
                            application2.get_Range("A5:V5", Missing.Value).Select();
                            object obj42 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj42, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj42, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj42, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj42, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj42, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj42, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj42, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj42, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj42, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj42 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("A5:V5", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = this.GetQuyNgayThang(this.strNamThang1, this.strNamThang2);
                            Excel.Font font2 = application2.ActiveCell.get_Characters(1, 200).Font;
                            font2.Name = "Times New Roman";
                            font2.FontStyle = "Bold";
                            font2.Size = 11;
                            font2.Strikethrough = false;
                            font2.Superscript = false;
                            font2.Subscript = false;
                            font2.OutlineFont = false;
                            font2.Shadow = false;
                            font2.Underline = -4142;
                            font2.ColorIndex = -4105;
                            font2 = null;
                            NewLateBinding.LateSetComplex(application2.Rows["5:5", Missing.Value], null, "RowHeight", new object[] { 20 }, null, null, false, true);
                            application2.get_Range("A7", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "1. T\x00ean tổ chức (c\x00e1 nh\x00e2n) : " + modGeneral.H_COMPANYNAMEVIET;
                            Excel.Font font3 = application2.ActiveCell.get_Characters(1, 300).Font;
                            font3.Name = "Times New Roman";
                            font3.FontStyle = "Bold";
                            font3.Size = 11;
                            font3.Strikethrough = false;
                            font3.Superscript = false;
                            font3.Subscript = false;
                            font3.OutlineFont = false;
                            font3.Shadow = false;
                            font3.Underline = -4142;
                            font3.ColorIndex = -4105;
                            font3 = null;
                            NewLateBinding.LateSetComplex(application2.Rows["7:7", Missing.Value], null, "RowHeight", new object[] { 15 }, null, null, false, true);
                            application2.get_Range("A8", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "2. M\x00e3 số thuế : " + modGeneral.H_TAXCODE;
                            Excel.Font font4 = application2.ActiveCell.get_Characters(1, 300).Font;
                            font4.Name = "Times New Roman";
                            font4.FontStyle = "Bold";
                            font4.Size = 11;
                            font4.Strikethrough = false;
                            font4.Superscript = false;
                            font4.Subscript = false;
                            font4.OutlineFont = false;
                            font4.Shadow = false;
                            font4.Underline = -4142;
                            font4.ColorIndex = -4105;
                            font4 = null;
                            NewLateBinding.LateSetComplex(application2.Rows["8:8", Missing.Value], null, "RowHeight", new object[] { 15 }, null, null, false, true);
                            application2.get_Range("A9", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "3. Địa chỉ : " + modGeneral.H_ADDRESS;
                            Excel.Font font5 = application2.ActiveCell.get_Characters(1, 300).Font;
                            font5.Name = "Times New Roman";
                            font5.FontStyle = "Bold";
                            font5.Size = 11;
                            font5.Strikethrough = false;
                            font5.Superscript = false;
                            font5.Subscript = false;
                            font5.OutlineFont = false;
                            font5.Shadow = false;
                            font5.Underline = -4142;
                            font5.ColorIndex = -4105;
                            font5 = null;
                            NewLateBinding.LateSetComplex(application2.Rows["9:9", Missing.Value], null, "RowHeight", new object[] { 15 }, null, null, false, true);
                            application2.get_Range("S10", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Đơn vị t\x00ednh : Số";
                            application2.get_Range("A1:V1", Missing.Value).Select();
                            object obj43 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj43, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj43, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj43, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj43, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj43, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj43, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj43, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj43, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj43, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj43 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("A1:V1", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "CỘNG H\x00d2A X\x00c3 HỘI CHỦ NGHĨA VIỆT NAM";
                            Excel.Font font6 = application2.ActiveCell.get_Characters(1, 100).Font;
                            font6.Name = "Times New Roman";
                            font6.FontStyle = "Bold";
                            font6.Size = 11;
                            font6.Strikethrough = false;
                            font6.Superscript = false;
                            font6.Subscript = false;
                            font6.OutlineFont = false;
                            font6.Shadow = false;
                            font6.Underline = -4142;
                            font6.ColorIndex = -4105;
                            font6 = null;
                            NewLateBinding.LateSetComplex(application2.Rows["1:1", Missing.Value], null, "RowHeight", new object[] { 0x11 }, null, null, false, true);
                            application2.get_Range("A2:V2", Missing.Value).Select();
                            object obj44 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj44, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj44, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj44, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj44, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj44, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj44, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj44, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj44, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj44, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj44 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("A2:V2", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Độc lập - Tự do - Hạnh ph\x00fac";
                            Excel.Font font7 = application2.ActiveCell.get_Characters(1, 100).Font;
                            font7.Name = "Times New Roman";
                            font7.FontStyle = "Bold";
                            font7.Size = 11;
                            font7.Strikethrough = false;
                            font7.Superscript = false;
                            font7.Subscript = false;
                            font7.OutlineFont = false;
                            font7.Shadow = false;
                            font7.Underline = -4142;
                            font7.ColorIndex = -4105;
                            font7 = null;
                            NewLateBinding.LateSetComplex(application2.Rows["2:2", Missing.Value], null, "RowHeight", new object[] { 0x11 }, null, null, false, true);
                            application2.get_Range("A11:V14", Missing.Value).Select();
                            NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Font", new object[0], null, null, null), null, "Bold", new object[] { true }, null, null, false, true);
                            application2.get_Range("A" + Conversions.ToString((int) (this.VSlist.Rows.Count + 10)) + ":V" + Conversions.ToString((int) (this.VSlist.Rows.Count + 10)), Missing.Value).Select();
                            NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Font", new object[0], null, null, null), null, "Bold", new object[] { true }, null, null, false, true);
                            application2.get_Range("A" + Conversions.ToString((int) (this.VSlist.Rows.Count + 11)), Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Cam kết b\x00e1o c\x00e1o t\x00ecnh h\x00ecnh sử dụng h\x00f3a đơn tr\x00ean đ\x00e2y l\x00e0 đ\x00fang sự thật, nếu sai, đơn vị chịu ho\x00e0n to\x00e0n tr\x00e1ch nhiệm trước ph\x00e1p luật.";
                            Excel.Font font8 = application2.ActiveCell.get_Characters(1, 200).Font;
                            font8.Name = "Times New Roman";
                            font8.FontStyle = "Regular";
                            font8.Size = 10;
                            font8 = null;
                            application2.get_Range("A" + Conversions.ToString((int) (this.VSlist.Rows.Count + 12)) + ":G" + Conversions.ToString((int) (this.VSlist.Rows.Count + 12)), Missing.Value).Select();
                            object obj45 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj45, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj45, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj45, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj45, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj45, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj45, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj45, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj45, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj45, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj45 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("A" + Conversions.ToString((int) (this.VSlist.Rows.Count + 12)) + ":G" + Conversions.ToString((int) (this.VSlist.Rows.Count + 12)), Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Người lập biểu\n(K\x00fd, ghi r\x00f5 họ, t\x00ean)";
                            Excel.Font font9 = application2.ActiveCell.get_Characters(1, 14).Font;
                            font9.Name = "Times New Roman";
                            font9.FontStyle = "Bold";
                            font9.Size = 10;
                            font9.Strikethrough = false;
                            font9.Superscript = false;
                            font9.Subscript = false;
                            font9.OutlineFont = false;
                            font9.Shadow = false;
                            font9.Underline = -4142;
                            font9.ColorIndex = -4105;
                            font9 = null;
                            Excel.Font font10 = application2.ActiveCell.get_Characters(15, 0x15).Font;
                            font10.Name = "Times New Roman";
                            font10.FontStyle = "Regular";
                            font10.Size = 10;
                            font10.Strikethrough = false;
                            font10.Superscript = false;
                            font10.Subscript = false;
                            font10.OutlineFont = false;
                            font10.Shadow = false;
                            font10.Underline = -4142;
                            font10.ColorIndex = -4105;
                            font10 = null;
                            application2.get_Range("N" + Conversions.ToString((int) (this.VSlist.Rows.Count + 12)) + ":V" + Conversions.ToString((int) (this.VSlist.Rows.Count + 12)), Missing.Value).Select();
                            object obj46 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj46, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj46, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj46, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj46, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj46, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj46, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj46, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj46, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj46, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj46 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("N" + Conversions.ToString((int) (this.VSlist.Rows.Count + 12)) + ":V" + Conversions.ToString((int) (this.VSlist.Rows.Count + 12)), Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "............, ng\x00e0y........... th\x00e1ng.......... năm...........\nNGƯỜI ĐẠI DIỆN THEO PH\x00c1P LUẬT\n(K\x00fd, ghi r\x00f5 họ, t\x00ean v\x00e0 đ\x00f3ng dấu)";
                            Excel.Font font11 = application2.ActiveCell.get_Characters(1, 0x3d).Font;
                            font11.Name = "Times New Roman";
                            font11.FontStyle = "Regular";
                            font11.Size = 10;
                            font11.Strikethrough = false;
                            font11.Superscript = false;
                            font11.Subscript = false;
                            font11.OutlineFont = false;
                            font11.Shadow = false;
                            font11.Underline = -4142;
                            font11.ColorIndex = -4105;
                            font11 = null;
                            Excel.Font font12 = application2.ActiveCell.get_Characters(0x3e, 0x1d).Font;
                            font12.Name = "Times New Roman";
                            font12.FontStyle = "Bold";
                            font12.Size = 10;
                            font12.Strikethrough = false;
                            font12.Superscript = false;
                            font12.Subscript = false;
                            font12.OutlineFont = false;
                            font12.Shadow = false;
                            font12.Underline = -4142;
                            font12.ColorIndex = -4105;
                            font12 = null;
                            Excel.Font font13 = application2.ActiveCell.get_Characters(0x5b, 0x21).Font;
                            font13.Name = "Times New Roman";
                            font13.FontStyle = "Regular";
                            font13.Size = 10;
                            font13.Strikethrough = false;
                            font13.Superscript = false;
                            font13.Subscript = false;
                            font13.OutlineFont = false;
                            font13.Shadow = false;
                            font13.Underline = -4142;
                            font13.ColorIndex = -4105;
                            font13 = null;
                            NewLateBinding.LateSetComplex(application2.Rows[Conversions.ToString((int) (this.VSlist.Rows.Count + 12)) + ":" + Conversions.ToString((int) (this.VSlist.Rows.Count + 12)), Missing.Value], null, "RowHeight", new object[] { 40 }, null, null, false, true);
                            application2.get_Range("A16:V" + Conversions.ToString((int) (this.VSlist.Rows.Count + 12)), Missing.Value).Select();
                            object obj47 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj47, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj47, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj47, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj47, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj47, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj47, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj47, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj47, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            obj47 = null;
                            application2.get_Range("B16:B" + Conversions.ToString((int) (this.VSlist.Rows.Count + 10)), Missing.Value).Select();
                            NewLateBinding.LateSetComplex(application2.Selection, null, "HorizontalAlignment", new object[] { -4131 }, null, null, false, true);
                            application2.get_Range("A" + Conversions.ToString((int) (this.VSlist.Rows.Count + 11)), Missing.Value).Select();
                            object obj49 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj49, null, "HorizontalAlignment", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj49, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj49, null, "WrapText", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj49, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj49, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj49, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj49, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj49, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj49, null, "MergeCells", new object[] { false }, null, null, false, true);
                            obj49 = null;
                            application2.get_Range("A4", Missing.Value).Select();
                            application2 = null;
                            application.SaveWorkspace(Missing.Value);
                            application.Visible = true;
                        }
                    }
                    catch (COMException exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        COMException exception = exception1;
                        MessageBox.Show(exception.Message);
                        ProjectData.ClearProjectError();
                    }
                    catch (Exception exception3)
                    {
                        ProjectData.SetProjectError(exception3);
                        Exception exception2 = exception3;
                        MessageBox.Show(exception2.Message);
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        private void CmdIn_Click(object sender, EventArgs e)
        {
            if (this.pData != null)
            {
                if (this.pData.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
                }
                else
                {
                    this.Cursor = Cursors.WaitCursor;
                    Rpt_BCTinhHinhSDHD hsdhd = new Rpt_BCTinhHinhSDHD();
                    try
                    {
                        hsdhd.SetDataSource(this.pData);
                        int left = 0;
                        int num7 = 0;
                        int num5 = 0;
                        int num8 = 0;
                        int num3 = 0;
                        int num2 = 0;
                        int num4 = 0;
                        int num9 = this.pData.Rows.Count - 1;
                        for (int i = 0; i <= num9; i++)
                        {
                            left = Conversions.ToInteger(Microsoft.VisualBasic.CompilerServices.Operators.AddObject(left, this.pData.Rows[i]["TongSo"]));
                            num7 = Conversions.ToInteger(Microsoft.VisualBasic.CompilerServices.Operators.AddObject(num7, this.pData.Rows[i]["TongSuDung"]));
                            num5 = Conversions.ToInteger(Microsoft.VisualBasic.CompilerServices.Operators.AddObject(num5, this.pData.Rows[i]["SuDung"]));
                            num8 = Conversions.ToInteger(Microsoft.VisualBasic.CompilerServices.Operators.AddObject(num8, this.pData.Rows[i]["XoaBo"]));
                            num3 = Conversions.ToInteger(Microsoft.VisualBasic.CompilerServices.Operators.AddObject(num3, this.pData.Rows[i]["Mat"]));
                            num2 = Conversions.ToInteger(Microsoft.VisualBasic.CompilerServices.Operators.AddObject(num2, this.pData.Rows[i]["Huy"]));
                            num4 = Conversions.ToInteger(Microsoft.VisualBasic.CompilerServices.Operators.AddObject(num4, this.pData.Rows[i]["SoLuongTonCuoi"]));
                        }
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            hsdhd.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            hsdhd.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        hsdhd.SetParameterValue(1, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        hsdhd.SetParameterValue(2, modGeneral.Tranlated(modGeneral.H_ADDRESS, ""));
                        hsdhd.SetParameterValue(4, left);
                        hsdhd.SetParameterValue(5, num7);
                        hsdhd.SetParameterValue(6, num5);
                        hsdhd.SetParameterValue(7, num8);
                        hsdhd.SetParameterValue(8, num3);
                        hsdhd.SetParameterValue(9, num2);
                        hsdhd.SetParameterValue(10, num4);
                        hsdhd.SetParameterValue(11, "........., ng\x00e0y " + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Today.Day), 2) + " th\x00e1ng " + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2) + " năm " + LVYModule.sRight("0000" + Conversions.ToString(DateAndTime.Year(DateAndTime.Today)), 4));
                        hsdhd.SetParameterValue(3, this.GetQuyNgayThang(this.strNamThang1, this.strNamThang2));
                        MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = hsdhd;
                        MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                        MyProject.Forms.Frm_ViewReport.ShowDialog();
                        this.Cursor = Cursors.Default;
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        this.Cursor = Cursors.Default;
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        private void CmdThoat_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void Frm_BCTinhHinhSuDungHoaDon_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.updNam1.Value = new decimal(DateAndTime.Year(DateAndTime.Today));
                this.updThang1.Value = new decimal(DateAndTime.Month(DateAndTime.Today));
                this.MergeColumn();
            }
        }

        public string GetQuyNgayThang(string pNamThang1, string pNamThang2)
        {
            if (pNamThang1 == pNamThang2)
            {
                return ("Th\x00e1ng " + LVYModule.sRight(pNamThang1, 2) + " - Năm " + LVYModule.sLeft(pNamThang1, 4));
            }
            if (LVYModule.sLeft(pNamThang1, 4) == LVYModule.sLeft(pNamThang2, 4))
            {
                if ((LVYModule.sRight(pNamThang1, 2) == "01") & (LVYModule.sRight(pNamThang2, 2) == "03"))
                {
                    return ("Qu\x00fd 1 - Năm " + LVYModule.sLeft(pNamThang1, 4));
                }
                if ((LVYModule.sRight(pNamThang1, 2) == "04") & (LVYModule.sRight(pNamThang2, 2) == "06"))
                {
                    return ("Qu\x00fd 2 - Năm " + LVYModule.sLeft(pNamThang1, 4));
                }
                if ((LVYModule.sRight(pNamThang1, 2) == "07") & (LVYModule.sRight(pNamThang2, 2) == "09"))
                {
                    return ("Qu\x00fd 3 - Năm " + LVYModule.sLeft(pNamThang1, 4));
                }
                if ((LVYModule.sRight(pNamThang1, 2) == "10") & (LVYModule.sRight(pNamThang2, 2) == "12"))
                {
                    return ("Qu\x00fd 4 - Năm " + LVYModule.sLeft(pNamThang1, 4));
                }
            }
            return ("Từ th\x00e1ng " + LVYModule.sRight(pNamThang1, 2) + "/" + LVYModule.sLeft(pNamThang1, 4) + " đến th\x00e1ng " + LVYModule.sRight(pNamThang2, 2) + "/" + LVYModule.sLeft(pNamThang2, 4));
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_BCTinhHinhSuDungHoaDon));
            this.Panel1 = new Panel();
            this.Panel3 = new Panel();
            this.CmdThoat = new System.Windows.Forms.Button();
            this.CmdExcel = new System.Windows.Forms.Button();
            this.CmdCapNhat = new System.Windows.Forms.Button();
            this.CmdIn = new System.Windows.Forms.Button();
            this.Label2 = new System.Windows.Forms.Label();
            this.Label1 = new System.Windows.Forms.Label();
            this.updNam2 = new NumericUpDown();
            this.updThang2 = new NumericUpDown();
            this.updNam1 = new NumericUpDown();
            this.updThang1 = new NumericUpDown();
            this.Panel2 = new Panel();
            this.VSlist = new FlexTHSDHD();
            this.Panel1.SuspendLayout();
            this.Panel3.SuspendLayout();
            this.updNam2.BeginInit();
            this.updThang2.BeginInit();
            this.updNam1.BeginInit();
            this.updThang1.BeginInit();
            this.VSlist.BeginInit();
            this.SuspendLayout();
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.Panel3);
            this.Panel1.Controls.Add(this.Label2);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.updNam2);
            this.Panel1.Controls.Add(this.updThang2);
            this.Panel1.Controls.Add(this.updNam1);
            this.Panel1.Controls.Add(this.updThang1);
            this.Panel1.Dock = DockStyle.Top;
            System.Drawing.Point point = new System.Drawing.Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            Size size = new Size(0x41e, 0x2e);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0;
            this.Panel3.BackColor = Color.Transparent;
            this.Panel3.Controls.Add(this.CmdThoat);
            this.Panel3.Controls.Add(this.CmdExcel);
            this.Panel3.Controls.Add(this.CmdCapNhat);
            this.Panel3.Controls.Add(this.CmdIn);
            this.Panel3.Dock = DockStyle.Right;
            point = new System.Drawing.Point(0x2d8, 0);
            this.Panel3.Location = point;
            this.Panel3.Name = "Panel3";
            size = new Size(0x146, 0x2e);
            this.Panel3.Size = size;
            this.Panel3.TabIndex = 5;
            point = new System.Drawing.Point(0xf6, 6);
            this.CmdThoat.Location = point;
            this.CmdThoat.Name = "CmdThoat";
            size = new Size(0x4b, 0x21);
            this.CmdThoat.Size = size;
            this.CmdThoat.TabIndex = 4;
            this.CmdThoat.Text = "Tho\x00e1t";
            this.CmdThoat.UseVisualStyleBackColor = true;
            point = new System.Drawing.Point(0xa5, 6);
            this.CmdExcel.Location = point;
            this.CmdExcel.Name = "CmdExcel";
            size = new Size(0x4b, 0x21);
            this.CmdExcel.Size = size;
            this.CmdExcel.TabIndex = 4;
            this.CmdExcel.Text = "Excel";
            this.CmdExcel.UseVisualStyleBackColor = true;
            point = new System.Drawing.Point(3, 6);
            this.CmdCapNhat.Location = point;
            this.CmdCapNhat.Name = "CmdCapNhat";
            size = new Size(0x4b, 0x21);
            this.CmdCapNhat.Size = size;
            this.CmdCapNhat.TabIndex = 4;
            this.CmdCapNhat.Text = "Cập nhật";
            this.CmdCapNhat.UseVisualStyleBackColor = true;
            point = new System.Drawing.Point(0x54, 6);
            this.CmdIn.Location = point;
            this.CmdIn.Name = "CmdIn";
            size = new Size(0x4b, 0x21);
            this.CmdIn.Size = size;
            this.CmdIn.TabIndex = 4;
            this.CmdIn.Text = "In b\x00e1o c\x00e1o";
            this.CmdIn.UseVisualStyleBackColor = true;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0xb7, 0x12);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x39, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 3;
            this.Label2.Text = "Đến th\x00e1ng";
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0x1b, 0x12);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(50, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 2;
            this.Label1.Text = "Từ th\x00e1ng";
            point = new System.Drawing.Point(0x11c, 15);
            this.updNam2.Location = point;
            decimal num = new decimal(new int[] { 0x9c4, 0, 0, 0 });
            this.updNam2.Maximum = num;
            num = new decimal(new int[] { 0x7c6, 0, 0, 0 });
            this.updNam2.Minimum = num;
            this.updNam2.Name = "updNam2";
            size = new Size(0x36, 20);
            this.updNam2.Size = size;
            this.updNam2.TabIndex = 1;
            num = new decimal(new int[] { 0x7c6, 0, 0, 0 });
            this.updNam2.Value = num;
            point = new System.Drawing.Point(0xf2, 15);
            this.updThang2.Location = point;
            num = new decimal(new int[] { 12, 0, 0, 0 });
            this.updThang2.Maximum = num;
            num = new decimal(new int[] { 1, 0, 0, 0 });
            this.updThang2.Minimum = num;
            this.updThang2.Name = "updThang2";
            size = new Size(40, 20);
            this.updThang2.Size = size;
            this.updThang2.TabIndex = 0;
            num = new decimal(new int[] { 1, 0, 0, 0 });
            this.updThang2.Value = num;
            point = new System.Drawing.Point(0x7a, 15);
            this.updNam1.Location = point;
            num = new decimal(new int[] { 0x9c4, 0, 0, 0 });
            this.updNam1.Maximum = num;
            num = new decimal(new int[] { 0x7c6, 0, 0, 0 });
            this.updNam1.Minimum = num;
            this.updNam1.Name = "updNam1";
            size = new Size(0x36, 20);
            this.updNam1.Size = size;
            this.updNam1.TabIndex = 1;
            num = new decimal(new int[] { 0x7c6, 0, 0, 0 });
            this.updNam1.Value = num;
            point = new System.Drawing.Point(80, 15);
            this.updThang1.Location = point;
            num = new decimal(new int[] { 12, 0, 0, 0 });
            this.updThang1.Maximum = num;
            num = new decimal(new int[] { 1, 0, 0, 0 });
            this.updThang1.Minimum = num;
            this.updThang1.Name = "updThang1";
            size = new Size(40, 20);
            this.updThang1.Size = size;
            this.updThang1.TabIndex = 0;
            num = new decimal(new int[] { 1, 0, 0, 0 });
            this.updThang1.Value = num;
            this.Panel2.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel2.Dock = DockStyle.Bottom;
            point = new System.Drawing.Point(0, 0x1a1);
            this.Panel2.Location = point;
            this.Panel2.Name = "Panel2";
            size = new Size(0x41e, 0x1d);
            this.Panel2.Size = size;
            this.Panel2.TabIndex = 1;
            this.VSlist.AllowEditing = false;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSlist.ColumnInfo = "22,0,0,0,0,85,Columns:0{Width:40;}\t1{Width:80;}\t";
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.FocusRect = FocusRectEnum.None;
            point = new System.Drawing.Point(0, 0x2e);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 5;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.Rows.Fixed = 5;
            this.VSlist.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x41e, 0x173);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 9;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            size = new Size(0x41e, 0x1be);
            this.ClientSize = size;
            this.Controls.Add(this.VSlist);
            this.Controls.Add(this.Panel2);
            this.Controls.Add(this.Panel1);
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.KeyPreview = true;
            this.Name = "Frm_BCTinhHinhSuDungHoaDon";
            this.Text = "BAO CAO TINH HINH SU DUNG HOA DON";
            this.WindowState = FormWindowState.Maximized;
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.Panel3.ResumeLayout(false);
            this.updNam2.EndInit();
            this.updThang2.EndInit();
            this.updNam1.EndInit();
            this.updThang1.EndInit();
            this.VSlist.EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            if (this.CheckIvalid())
            {
                this.Cursor = Cursors.WaitCursor;
                this.VSlist.Select(0, 1);
                this.VSlist.Rows.Count = 5;
                this.strNamThang1 = LVYModule.sRight("0000" + this.updNam1.Value.ToString(), 4) + LVYModule.sRight("00" + Conversions.ToString(this.updThang1.Value), 2);
                this.strNamThang2 = LVYModule.sRight("0000" + this.updNam2.Value.ToString(), 4) + LVYModule.sRight("00" + Conversions.ToString(this.updThang2.Value), 2);
                this.pData = this.objXK.GetDataPrintTinhHinhSuDungHoaDon(this.strNamThang1, this.strNamThang2);
                int num4 = this.pData.Rows.Count - 1;
                for (int i = 0; i <= num4; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 0] = LVYModule.sRight("00" + Conversions.ToString((int) (i + 1)), 2);
                    vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["LoaiHoaDon"]);
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["MauHoaDon"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoKiHieu"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["TongSo"]);
                    vSlist[vSlist.Rows.Count - 1, 5] = LVYModule.sRight(Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject("0000000", this.pData.Rows[i]["TonDau1"])), 7);
                    vSlist[vSlist.Rows.Count - 1, 6] = LVYModule.sRight(Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject("0000000", this.pData.Rows[i]["TonDau2"])), 7);
                    vSlist[vSlist.Rows.Count - 1, 7] = LVYModule.sRight(Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject("0000000", this.pData.Rows[i]["PhatHanh1"])), 7);
                    vSlist[vSlist.Rows.Count - 1, 8] = LVYModule.sRight(Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject("0000000", this.pData.Rows[i]["PhatHanh2"])), 7);
                    vSlist[vSlist.Rows.Count - 1, 9] = LVYModule.sRight(Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject("0000000", this.pData.Rows[i]["SuDung1"])), 7);
                    vSlist[vSlist.Rows.Count - 1, 10] = LVYModule.sRight(Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject("0000000", this.pData.Rows[i]["SuDung2"])), 7);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["TongSuDung"]);
                    vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SuDung"]);
                    vSlist[vSlist.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["XoaBo"]);
                    vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoXoaBo"]);
                    vSlist[vSlist.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["Mat"]);
                    vSlist[vSlist.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoMat"]);
                    vSlist[vSlist.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["Huy"]);
                    vSlist[vSlist.Rows.Count - 1, 0x12] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoHuy"]);
                    vSlist[vSlist.Rows.Count - 1, 0x13] = LVYModule.sRight(Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject("0000000", this.pData.Rows[i]["TonCuoi1"])), 7);
                    vSlist[vSlist.Rows.Count - 1, 20] = LVYModule.sRight(Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject("0000000", this.pData.Rows[i]["TonCuoi2"])), 7);
                    vSlist[vSlist.Rows.Count - 1, 0x15] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoLuongTonCuoi"]);
                    vSlist = null;
                    int num5 = this.VSlist.Cols.Count - 1;
                    for (int j = 0; j <= num5; j++)
                    {
                        if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.VSlist[this.VSlist.Rows.Count - 1, j], "0000000", false))
                        {
                            this.VSlist[this.VSlist.Rows.Count - 1, j] = " ";
                        }
                    }
                }
                this.VSlist.AddItem("");
                this.VSlist.AddItem("");
                this.VSlist[this.VSlist.Rows.Count - 1, 1] = "Tổng cộng";
                this.VSlist[this.VSlist.Rows.Count - 1, 4] = LVYModule.SumColGrid(this.VSlist, 4);
                this.VSlist[this.VSlist.Rows.Count - 1, 12] = LVYModule.SumColGrid(this.VSlist, 12);
                this.VSlist[this.VSlist.Rows.Count - 1, 13] = LVYModule.SumColGrid(this.VSlist, 13);
                this.VSlist[this.VSlist.Rows.Count - 1, 15] = LVYModule.SumColGrid(this.VSlist, 15);
                this.VSlist[this.VSlist.Rows.Count - 1, 0x11] = LVYModule.SumColGrid(this.VSlist, 0x11);
                this.VSlist[this.VSlist.Rows.Count - 1, 0x15] = LVYModule.SumColGrid(this.VSlist, 0x15);
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.VSlist[this.VSlist.Rows.Count - 1, 4], 0, false))
                {
                    this.VSlist[this.VSlist.Rows.Count - 1, 4] = "";
                }
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.VSlist[this.VSlist.Rows.Count - 1, 12], 0, false))
                {
                    this.VSlist[this.VSlist.Rows.Count - 1, 12] = "";
                }
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.VSlist[this.VSlist.Rows.Count - 1, 13], 0, false))
                {
                    this.VSlist[this.VSlist.Rows.Count - 1, 13] = "";
                }
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.VSlist[this.VSlist.Rows.Count - 1, 15], 0, false))
                {
                    this.VSlist[this.VSlist.Rows.Count - 1, 15] = "";
                }
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.VSlist[this.VSlist.Rows.Count - 1, 0x11], 0, false))
                {
                    this.VSlist[this.VSlist.Rows.Count - 1, 0x11] = "";
                }
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.VSlist[this.VSlist.Rows.Count - 1, 0x15], 0, false))
                {
                    this.VSlist[this.VSlist.Rows.Count - 1, 0x15] = "";
                }
                LVYModule.SetColorForGrid(this.VSlist, Color.GreenYellow, this.VSlist.Rows.Count - 1, 0, 0, 0);
                this.Cursor = Cursors.Default;
            }
        }

        public void MergeColumn()
        {
            int num;
            CellRange range = new CellRange();
            //this.VSlist.GetCellRange(0, 0, 3, 0).Data = "STT";
            //this.VSlist.GetCellRange(0, 1, 3, 1).Data = "T\x00ean loại h\x00f3a đơn";
            //this.VSlist.GetCellRange(0, 2, 3, 2).Data = "K\x00fd hiệu mẫu h\x00f3a đơn";
            //this.VSlist.GetCellRange(0, 3, 3, 3).Data = "K\x00fd hiệu h\x00f3a đơn";
            //this.VSlist.GetCellRange(0, 4, 0, 8).Data = "Số tồn đầu kỳ, mua/ph\x00e1t h\x00e0nh trong kỳ";
            //this.VSlist.GetCellRange(0, 9, 0, 0x12).Data = "Số sử dụng, x\x00f3a bỏ, mất, hủy trong kỳ";
            //this.VSlist.GetCellRange(0, 0x13, 2, 0x15).Data = "Tồn cuối kỳ";
            //this.VSlist.GetCellRange(1, 4, 3, 4).Data = "Tổng số";
            //this.VSlist.GetCellRange(1, 12, 1, 0x12).Data = "Trong đ\x00f3";
            //this.VSlist.GetCellRange(2, 12, 3, 12).Data = "Số lượng đ\x00e3 sử dụng";
            //this.VSlist.GetCellRange(1, 5, 2, 6).Data = "Số tồn đầu kỳ";
            //this.VSlist.GetCellRange(1, 7, 2, 8).Data = "Số mua/ph\x00e1t h\x00e0nh trong kỳ";
            //this.VSlist.GetCellRange(1, 9, 2, 11).Data = "Tổng số sử dụng, x\x00f3a bỏ, mất, hủy";
            this.VSlist[3, 5] = "Từ số";
            this.VSlist[3, 7] = "Từ số";
            this.VSlist[3, 9] = "Từ số";
            this.VSlist[3, 0x13] = "Từ số";
            this.VSlist[3, 6] = "Đến số";
            this.VSlist[3, 8] = "Đến số";
            this.VSlist[3, 10] = "Đến số";
            this.VSlist[3, 20] = "Đến số";
            this.VSlist[3, 13] = "Số lượng";
            this.VSlist[3, 15] = "Số lượng";
            this.VSlist[3, 0x11] = "Số lượng";
            this.VSlist[3, 0x15] = "Số lượng";
            this.VSlist[3, 14] = "Số";
            this.VSlist[3, 0x10] = "Số";
            this.VSlist[3, 0x12] = "Số";
            this.VSlist[3, 11] = "Cộng";
            this.VSlist[2, 13] = "X\x00f3a bỏ";
            this.VSlist[2, 14] = "X\x00f3a bỏ";
            this.VSlist[2, 15] = "Mất";
            this.VSlist[2, 0x10] = "Mất";
            this.VSlist[2, 0x11] = "Hủy";
            this.VSlist[2, 0x12] = "Hủy";
            this.VSlist.Rows[0].Height = 40;
            this.VSlist.Rows[1].Height = 40;
            this.VSlist.Rows[2].Height = 30;
            this.VSlist.Rows[3].Height = 40;
            this.VSlist.Cols[0].Width = 30;
            this.VSlist.Cols[1].Width = 100;
            this.VSlist.Cols[2].Width = 90;
            this.VSlist.Cols[3].Width = 70;
            this.VSlist.Cols[4].Width = 40;
            this.VSlist.Cols[5].Width = 60;
            this.VSlist.Cols[6].Width = 60;
            this.VSlist.Cols[7].Width = 60;
            this.VSlist.Cols[8].Width = 60;
            this.VSlist.Cols[9].Width = 60;
            this.VSlist.Cols[10].Width = 60;
            this.VSlist.Cols[11].Width = 40;
            this.VSlist.Cols[12].Width = 40;
            this.VSlist.Cols[13].Width = 40;
            this.VSlist.Cols[14].Width = 60;
            this.VSlist.Cols[15].Width = 40;
            this.VSlist.Cols[0x10].Width = 60;
            this.VSlist.Cols[0x11].Width = 40;
            this.VSlist.Cols[0x12].Width = 60;
            this.VSlist.Cols[0x13].Width = 60;
            this.VSlist.Cols[20].Width = 60;
            this.VSlist.Cols[0x15].Width = 40;
            int num4 = this.VSlist.Cols.Count - 1;
            for (num = 0; num <= num4; num++)
            {
                this.VSlist[4, num] = "[ " + Conversions.ToString((int) (num + 1)) + " ]";
            }
            this.VSlist.Styles.Fixed.WordWrap = true;
            int num5 = this.VSlist.Cols.Count - 1;
            for (num = 0; num <= num5; num++)
            {
                this.VSlist.Cols[num].AllowMerging = true;
            }
            this.VSlist.AllowMerging = AllowMergingEnum.FixedOnly;
            int num6 = this.VSlist.Cols.Count - 1;
            for (int i = 0; i <= num6; i++)
            {
                this.VSlist.Cols[i].TextAlignFixed = TextAlignEnum.CenterCenter;
            }
        }

        private void updNam1_ValueChanged(object sender, EventArgs e)
        {
            this.updThang2.Value = this.updThang1.Value;
            this.updNam2.Value = this.updNam1.Value;
        }

        private void updThang1_ValueChanged(object sender, EventArgs e)
        {
            this.updThang2.Value = this.updThang1.Value;
            this.updNam2.Value = this.updNam1.Value;
        }

        internal virtual System.Windows.Forms.Button CmdCapNhat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCapNhat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCapNhat_Click);
                if (this._CmdCapNhat != null)
                {
                    this._CmdCapNhat.Click -= handler;
                }
                this._CmdCapNhat = value;
                if (this._CmdCapNhat != null)
                {
                    this._CmdCapNhat.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdExcel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExcel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExcel_Click);
                if (this._CmdExcel != null)
                {
                    this._CmdExcel.Click -= handler;
                }
                this._CmdExcel = value;
                if (this._CmdExcel != null)
                {
                    this._CmdExcel.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdIn
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdIn;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdIn_Click);
                if (this._CmdIn != null)
                {
                    this._CmdIn.Click -= handler;
                }
                this._CmdIn = value;
                if (this._CmdIn != null)
                {
                    this._CmdIn.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdThoat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdThoat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdThoat_Click);
                if (this._CmdThoat != null)
                {
                    this._CmdThoat.Click -= handler;
                }
                this._CmdThoat = value;
                if (this._CmdThoat != null)
                {
                    this._CmdThoat.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel2 = value;
            }
        }

        internal virtual Panel Panel3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel3 = value;
            }
        }

        internal virtual NumericUpDown updNam1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._updNam1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.updNam1_ValueChanged);
                if (this._updNam1 != null)
                {
                    this._updNam1.ValueChanged -= handler;
                }
                this._updNam1 = value;
                if (this._updNam1 != null)
                {
                    this._updNam1.ValueChanged += handler;
                }
            }
        }

        internal virtual NumericUpDown updNam2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._updNam2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._updNam2 = value;
            }
        }

        internal virtual NumericUpDown updThang1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._updThang1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.updThang1_ValueChanged);
                if (this._updThang1 != null)
                {
                    this._updThang1.ValueChanged -= handler;
                }
                this._updThang1 = value;
                if (this._updThang1 != null)
                {
                    this._updThang1.ValueChanged += handler;
                }
            }
        }

        internal virtual NumericUpDown updThang2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._updThang2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._updThang2 = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSlist = value;
            }
        }
    }
}

